package main

import (
	"fmt"
	"log"
	"net/http"
)

func home(responseWriter http.ResponseWriter, request *http.Request) {
	_ = request.ParseForm()
	fmt.Println(request.Form)
	fmt.Println("path:", request.URL.Path)
	fmt.Println("host", request.Host)
	fmt.Fprintf(responseWriter,"hello,host: %s,path: %s, method:%s",request.Host, request.URL.Path, request.Method)
}

func main() {
	http.HandleFunc("/", home)
	err := http.ListenAndServe(":8087", nil)
	if err != nil {
		log.Fatal("listen server", 8087, " ", err)
	}
}
